#pragma once
/* Copyright (C) 2009 Vlad Roubtsov. All rights reserved. */

#include <boost/numeric/conversion/converter.hpp>

//----------------------------------------------------------------------------
namespace vr
{
namespace deject
{
namespace factory
{
/**
 *
 */
template<typename FROM, typename TO>
class conversion
{
    public: // ...............................................................

        typedef boost::numeric::converter<TO, FROM> converter_t; // rounding direction defaults to "towards zero" (Trunc)

        static inline
        TO convert (const FROM src)
        {
            // TODO wrap boost overflow etc exceptions

            return converter_t::convert (src);
        }

    protected: // ............................................................

    private: // ..............................................................

}; // end of class

} // end of 'factory'
} // end of 'deject'
} // end of namespace
//----------------------------------------------------------------------------
